<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Prosentase_charge extends Authenticated_Controller{
	
	function __construct() {
		parent::__construct();
		$this->load->model('prosentase_charge_model','prosentase_charge');
                $this->load->model('coa_cabang_model','coa_cabang');
                $this->load->model('fee_driver_model','fee');
	}
	
	function index(){
		$this->list_prosentase_charge();
	}
	
	function list_prosentase_charge(){
		$data['daftar_prosentase_charge'] = $this->prosentase_charge->get_all();
		$this->load->view('template/header_view');
		$this->load->view('prosentase_charge/daftar_prosentase_charge',$data);
		$this->load->view('template/footer_view');
	}
	
	function form_add_prosentase_charge(){
                $data['daftar_cabang'] = $this->fee->get_asal_tujuan();
		$this->load->view('template/header_view');
		$this->load->view('prosentase_charge/form_add_prosentase_charge',$data);
		$this->load->view('template/footer_view');
	}
	
	function process_add_prosentase_charge(){
		$this->prosentase_charge->insert_new($_POST);
		redirect(PRC);
	}
	
	function process_delete_prosentase_charge($id){
		$this->prosentase_charge->delete_old($id);
		redirect(PRC);
	}
	
	function form_edit_prosentase_charge($id){
		$data = $this->prosentase_charge->get_one($id);
                $data['daftar_cabang'] = $this->fee->get_asal_tujuan();
		$this->load->view('template/header_view');
		$this->load->view('prosentase_charge/form_edit_prosentase_charge',$data);
		$this->load->view('template/footer_view');
	}
	
	function process_edit_prosentase_charge($id){
		$this->prosentase_charge->update_old($id,$_POST);
		redirect(PRC);
	}
}

/* End of file home.php */
/* Location: ./application/controllers/home.php */
